﻿#include "FITKAbaStepBuckle.h"

namespace Interface
{
    FITKAbaStepBuckle::FITKAbaStepBuckle()
    {
        m_nlgeom = false;
    }

    FITKAbaAbstractStep::FITKAbaStepType Interface::FITKAbaStepBuckle::getStepType() const
    {
        return FITKAbaStepType::Buckle;
    }

    bool FITKAbaStepBuckle::copy(FITKAbstractDataObject* obj)
    {
        FITKAbaStepBuckle* buckle = dynamic_cast<FITKAbaStepBuckle*>(obj);
        if (buckle == nullptr) return false;
        
        FITKAbaAbstractStep::copy(obj);

        _eigenSolver = buckle->getEigensolver();
        _numberOfEigenValues = buckle->getNumberOfEigenValuesRequset();
        _isMinEigenvalueInterest = buckle->isEnableMinEigenvalueInterest();
        _minEigenvalueInterest = buckle->getMinEigenvalueInterest();
        _isMaxEigenvalueInterest = buckle->isEnableMaxEigenvalueInterest();
        _maxEigenvalueInterest = buckle->getMaxEigenvalueInterest();
        _blockSize = buckle->getBlockSize();
        _blockSizeValue = buckle->getBlockSizeValue();
        _maxNumOfBlockLanczos = buckle->getMaximumNumberOfBlockLanczosStep();
        _maxNumOfBlockLanczosValue = buckle->getMaximumNumberOfBlockLanczosStepValue();
        _vectorsUsedInPerIter = buckle->getVectorsUsedPerIteration();
        _maxNumberOfIter = buckle->getMaxNumberOfIterations();
        _matrixStorage = this->getMatrixStorage();
        return true;
    }

    void FITKAbaStepBuckle::setEigensolver(Eigensolver s)
    {
        _eigenSolver = s;
    }

    Interface::FITKAbaAbstractStep::Eigensolver FITKAbaStepBuckle::getEigensolver() const
    {
        return _eigenSolver;
    }

    void FITKAbaStepBuckle::setNumberOfEigenValuesRequset(int n)
    {
        _numberOfEigenValues = n;
    }

    int FITKAbaStepBuckle::getNumberOfEigenValuesRequset() const
    {
        return _numberOfEigenValues;
    }

    void FITKAbaStepBuckle::enableMinEigenvalueInterest(bool enable)
    {
        _isMinEigenvalueInterest = enable;
    }

    bool FITKAbaStepBuckle::isEnableMinEigenvalueInterest() const
    {
        return _isMinEigenvalueInterest;
    }

    void FITKAbaStepBuckle::setMinEigenvalueInterest(const double v)
    {
        _minEigenvalueInterest = v;
    }

    double FITKAbaStepBuckle::getMinEigenvalueInterest() const
    {
        return _minEigenvalueInterest;
    }

    void FITKAbaStepBuckle::enableMaxEigenvalueInterest(bool enable)
    {
        _isMaxEigenvalueInterest = enable;
    }

    bool FITKAbaStepBuckle::isEnableMaxEigenvalueInterest() const
    {
        return _isMaxEigenvalueInterest;
    }

    void FITKAbaStepBuckle::setMaxEigenvalueInterest(const double v)
    {
        _maxEigenvalueInterest = v;
    }

    double FITKAbaStepBuckle::getMaxEigenvalueInterest() const
    {
        return _maxEigenvalueInterest;
    }

    void FITKAbaStepBuckle::setBlockSize(BlockSize b)
    {
        _blockSize = b;
    }

    Interface::FITKAbaAbstractStep::BlockSize FITKAbaStepBuckle::getBlockSize() const
    {
        return _blockSize;
    }

    void FITKAbaStepBuckle::setBlockSizeValue(int v)
    {
        _blockSizeValue = v;
    }

    int FITKAbaStepBuckle::getBlockSizeValue() const
    {
        return _blockSizeValue;
    }

    void FITKAbaStepBuckle::setMaximumNumberOfBlockLanczosStep(MaximumNumberOfBlockLanczosStep tp)
    {
        _maxNumOfBlockLanczos = tp;
    }

    Interface::FITKAbaAbstractStep::MaximumNumberOfBlockLanczosStep FITKAbaStepBuckle::getMaximumNumberOfBlockLanczosStep() const
    {
        return _maxNumOfBlockLanczos;
    }

    void FITKAbaStepBuckle::setMaximumNumberOfBlockLanczosStepValue(int n)
    {
        _maxNumOfBlockLanczosValue = n;
    }

    int FITKAbaStepBuckle::getMaximumNumberOfBlockLanczosStepValue() const
    {
        return _maxNumOfBlockLanczosValue;
    }

    void FITKAbaStepBuckle::setVectorsUsedPerIteration(int n)
    {
        _vectorsUsedInPerIter = n;
    }

    int FITKAbaStepBuckle::getVectorsUsedPerIteration() const
    {
        return _vectorsUsedInPerIter;
    }

    void FITKAbaStepBuckle::setMaxNumberOfIterations(const int n)
    {
        _maxNumberOfIter = n;
    }

    int FITKAbaStepBuckle::getMaxNumberOfIterations() const
    {
        return _maxNumberOfIter;
    }

    void FITKAbaStepBuckle::setMatrixStorage(MatrixStorage m)
    {
        _matrixStorage = m;
    }

    Interface::FITKAbaAbstractStep::MatrixStorage FITKAbaStepBuckle::getMatrixStorage() const
    {
        return _matrixStorage;
    }

}


